package main

import "fmt"

func main() {
	defer func() {
		r := recover()
		if err, ok := r.(error); ok {
			fmt.Println("recovered", err.Error())
		} else {
			panic(r)
		}
	}()
	a := []int{1, 2, 3}
	b := make([]int, 5)
	fmt.Println(a[6])
	fmt.Println(b[5])
}
